import React from 'react'
const search = React.lazy(() => import('../views/search'))
const Layout = React.lazy(() => import('../views/layout'))
const Detail = React.lazy(() => import('../views/detail'))

const Home = React.lazy(() => import('../views/layout/home'))
const Classify = React.lazy(() => import('../views/layout/classify'))
const Car = React.lazy(() => import('../views/layout/car'))
const My = React.lazy(() => import('../views/layout/my'))

export interface IRoute {
	path: string
	element: React.FC,
	children?: IRoute[]
}


const routes: IRoute[] = [{
	path: '/search',
	element: search
}, {
	path: '/',
	element: Layout,
	children: [{
		path: '/',
		element: Home,
	}, {
		path: '/classify',
		element: Classify,
	}, {
		path: '/car',
		element: Car,
	}, {
		path: '/my',
		element: My,
	}]
}, {
	path: '/detail',
	element: Detail
}]


export default routes